package com.itheima.web.client.userlogincontrol.Userregistration;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author 黄汉江
 * @date 2023/11/4 16:08
 * @description:
 */
public interface UserAuthorityRepository extends JpaRepository<UserAuthority,Integer> {
    @Query(value = "select a.* from t_user c,t_authority a,t_user_authority ca where ca.user_id=c.id and ca.authority_id=a.id and c.username=?1", nativeQuery = true)
    List<UserAuthority> findAuthoritiesByUsername(String username);

}